webif: add validation for single ports
authorFelix Fietkau <[email protected]>
Tue, 7 Feb 2006 04:21:02 +0000 (04:21 +0000)
committerFelix Fietkau <[email protected]>
Tue, 7 Feb 2006 04:21:02 +0000 (04:21 +0000)
SVN-Revision: 3173

openwrt/package/webif/files/usr/lib/webif/validate.awk

index 69f77c6da6e035de784ccc9ae3275021147eceeb..60b5915e241e83fee8334bd961e451f8ee722ac8 100644 (file)
@@ -70,6 +70,14 @@ $1 == "mac" {
        }
 }
 
+$1 == "port" {
+       valid_type = 1
+       if (value !~ /^[0-9]*$/) {
+               valid = 0
+               verr = "@TR<<Invalid value>>"
+       }
+}
+
 $1 == "ports" {
        valid_type = 1
        n = split(value ",", ports, ",")